Skip to content

Conversation

encima
Copy link
Member

@encima encima commented Sep 15, 2025

What kind of change does this PR introduce?

Feature

What is the current behavior?

Currently, migration of a project, subscription management and moving projects to a new region are restricted.
PG17 and up makes this easier as it allows subscriptions for non superusers but with more control on system schemas, users are unable to migrate projects to a new region with minimal downtime.

What is the new behavior?

A schema we use internally for testing and special cases allows subscriptions to be created by the superuser, allowing users to create subscriptions in Supabase projects for schemas like Auth, Storage etc

This PR is a proposal to make that schema available to all new projects and unlock the "self-serve" ability for users to migrate between projects

Additional context

Example usage:

SELECT supabase_subscription_mgmt.pg_create_subscription(
    'my_subscription', -- local name for the subscription
    'host=db.<project_ref>.supabase.co port=5432 dbname=postgres user=postgres password=<password>',
    'my_publication', -- publication
    'pubsub', -- slot
    true, -- copy data
    'any' -- origin
);

Potentially this could go into schema.sql but adding as a migration for easier rollback and modification if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant